﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
    /// <summary>
    /// Extensions of the <see cref="Assert"/> class.
    /// </summary>
    public static class AssertEx
    {
        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TType"></typeparam>
        /// <param name="ob"></param>
        public static void IsInstanceOf<TType>(object ob)
        {
            IsInstanceOf<TType>(ob, "");
        }

        /// <summary>
        /// 
        /// </summary>
        /// <typeparam name="TType"></typeparam>
        /// <param name="ob"></param>
        /// <param name="message"></param>
        public static void IsInstanceOf<TType>(object ob, string message)
        {
            if (!typeof(TType).IsAssignableFrom(ob.GetType()))
            {
                Assert.Fail(message);
            }
        }
    }
}
